package cn.xiao.permission_system.common;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 自定义通用mapper
 * @author beth
 * @data 2019-10-23 23:09
 */
public interface MyMapper<T> extends BaseMapper<T> {

    /**
     * 删除所有
     * @return
     */
    int deleteAll();

    /**
     * 批量新增
     * @param list
     * @return
     */
    int insertBatchSomeColumn(List<T> list);

    /**
     * 根据条件删除
     * @param entity
     * @return
     */
    int deleteByWithFill(T entity);

    /**
     * 固定某些字段一定会修改
     * @param entity
     * @return
     */
    int AlwaysUpdateSomeColumnById(@Param(Constants.ENTITY) T entity);
}
